package com.qf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qf.mapper.DtsGoodsProductMapper;
import com.qf.pojo.DtsGoodsProduct;
import com.qf.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    DtsGoodsProductMapper goodsProduct;

    @Override
    public List<DtsGoodsProduct> findAttributesByGoodsId(Integer id) {
        LambdaQueryWrapper<DtsGoodsProduct> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(DtsGoodsProduct::getGoodsId, id);
        wrapper.eq(DtsGoodsProduct::getDeleted, false);

        List<DtsGoodsProduct> dtsGoodsProducts = goodsProduct.selectList(wrapper);

        return dtsGoodsProducts;
    }
}
